#ifndef BUTTONRELAY_H
#define BUTTONRELAY_H

#include <QPushButton>
#include "button.h"

#define RELAY_STATUS_OFF        0x00
#define RELAY_STATUS_ON         0x01
#define RELAY_STATUS_AIR        0x02
#define RELAY_STATUS_COOLING    0x03
#define RELAY_STATUS_HEATING    0x04

#define RELAY_STATUS_PENDING    0x20    // pending or shutdown
#define RELAY_STATUS_UNKNOWN    0x40
#define RELAY_STATUS_NOTUSED    0x80

#define RELAY_TYPE_RELAY        0x00
#define RELAY_TYPE_REMOTE       0x01

class ButtonRelay : public QPushButton
{
public:
    ButtonRelay(Button& button);

    virtual QSize sizeHint() const;

    Button& button2();
    const Button *button();
    void setStatus(int status);

    enum {
        DefWidth=100,DefHeight=100
    };

protected:
    virtual void paintEvent(QPaintEvent *e);

private:
    QPixmap mPixmapBackground;
    QPixmap mPixmapStatus;

    Button mButton;
};

#endif // BUTTONRELAY_H
